Queue template. More...
#include <tqueue.h>
Public Member Functions | |
TQueue () | |
Default queue constructor. | |
TQueue (const TQueue< T > &) | |
Queue copy constructor. | |
~TQueue () | |
Queue destructor. | |
TQueue< T > & | operator= (const TQueue< T > &) |
Assignment operator. | |
bool | enqueue (const T &) |
Push item into queue. | |
T | dequeue () |
Pop front item from queue. | |
T & | peek () const |
Return copy of front item. |
Queue template.
A queue is a "first in first out" (FIFO) data structure. Elements are added to the back of the queue and may be removed from the front. Queue does not allow iteration through its elements. Only the top item of the queue can be examined.
TQueue | ( | ) | [inline] |
Default queue constructor.
Queue copy constructor.
"TQueue" is the queue copy constructor.
[in] | queue | : source queue |
~TQueue | ( | ) | [inline] |
Queue destructor.
Assignment operator.
The operator "=" copies the content of the input queue into this queue.
[in] | queue | : source queue |
Reimplemented from TLinkedList< T >.
bool enqueue | ( | const T & | obj | ) | [inline] |
Push item into queue.
The method "enqueue" adds a new item at the end of the queue.
[in] | obj | : the new item which will be added to the queue. |
T dequeue | ( | ) | [inline] |
Pop front item from queue.
The method "dequeue" removes the top item from the queue.
T & peek | ( | ) | const [inline] |
Return copy of front item.
The method "peek" returns a copy of the top queue item.